import Iterator.*;
import ObjectList.AbstractObjectList;
import ObjectList.ProductList;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("A");
        list.add("B");
        list.add("C");
        list.add("D");
        list.add("E");
        ProductList A = new ProductList(list);
        Iterator x = new ProductIterator(A);
        //x当前指向最后一项"E"
        x.previous();
        //x当前指向       "D"
        System.out.println(x.getPreviousItem());
        System.out.println(x.getNextItem());
    }
}